home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / fsovl / defs.h < prev    next >
C/C++ Source or Header  |  1997-09-09  |  3KB  |  104 lines

  1.  
  2. /*
  3.  *  DEFS.H
  4.  *
  5.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  6.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  7.  *    DICE-LICENSE.TXT.
  8.  */
  9.  
  10. #include <exec/types.h>
  11. #include <exec/nodes.h>
  12. #include <exec/ports.h>
  13. #include <exec/memory.h>
  14. #include <dos/dos.h>
  15. #include <dos/dosextens.h>
  16. #include <dos/filehandler.h>
  17.  
  18. #include <clib/exec_protos.h>
  19. #include <clib/alib_protos.h>
  20. #include <lists.h>
  21.  
  22. #include <stdio.h>
  23. #include <stdarg.h>
  24. #include <stdlib.h>
  25. #include <string.h>
  26.  
  27. #include <lib/version.h>
  28.  
  29. #define Prototype extern
  30.  
  31. #define DOS_TRUE    -1
  32. #define DOS_FALSE   0
  33.  
  34. #define GEF_DIRTY    0x00000001
  35. #define GEF_COMPRESSED    0x00000002
  36. #define GEF_CACHED    0x00000004
  37. #define GEF_DIRECTORY    0x00000008
  38.  
  39. #define BTOC(bptr)  ((void *)((long)(bptr) << 2))
  40. #define CTOB(cptr)  ((BPTR)(((long)cptr) >> 2))
  41.  
  42. #ifdef FSDEBUG
  43. #define dbprintf(x) if (DDebug) printf x
  44. #else
  45. #define dbprintf(x)
  46. #endif
  47.  
  48. typedef unsigned char ubyte;
  49. typedef unsigned short uword;
  50. typedef unsigned long ulong;
  51.  
  52. typedef struct DosList        DosList;
  53. typedef struct RootNode        RootNode;
  54. typedef struct DosInfo        DosInfo;
  55. typedef struct DosPacket    DosPacket;
  56. typedef struct StandardPacket StdPacket;
  57. typedef struct FileHandle   FileHandle;
  58. typedef struct DeviceNode   DeviceNode;
  59. typedef struct Process        Process;
  60. typedef struct Node        Node;
  61. typedef struct List        List;
  62. typedef struct MsgPort        MsgPort;
  63. typedef struct Message        Message;
  64. typedef struct FileLock        FileLock;
  65. typedef struct FileInfoBlock FileInfoBlock;
  66.  
  67. /*
  68.  * GEntry - control node for a file or directory in the heirarchy.
  69.  *
  70.  * MUST BE LONGWORD ALIGNED (BSTR requirements in AllocGEntry)
  71.  */
  72.  
  73. typedef struct GEntry {
  74.     Node    ge_Node;        // node in dir list, file/dir name, type
  75.     short   ge_Pad;
  76.     long    ge_Lock;        // lock in overlayed filesystem
  77.     uword   ge_FHRefs;        // file handle refs
  78.     uword   ge_LCRefs;        // lock refs, including parent dir
  79.     List    ge_List;        // if directory, list of sub-files
  80.     ubyte   *ge_SoftLink;    // if softlink, pointer to relative link path
  81.     ubyte   *ge_Buf;        // file buffer
  82.     long    ge_Bytes;        // uncompressed file size (loaded or not)
  83.     long    ge_Max;        // maximum allocated so far
  84.     ulong   ge_Flags;        // various flags
  85.     struct GEntry *ge_Parent;    // parent lock, NULL if root
  86. } GEntry;
  87.  
  88. #define GETYPE_FILE    1
  89. #define GETYPE_DIR    2
  90.  
  91. /*
  92.  * GHandle - control node representing an overlayed file handle
  93.  */
  94.  
  95. typedef struct GHandle {
  96.     // Node    gh_Node;        // list of handles
  97.     long    gh_Pos;        // current position
  98.     long    gh_Mode;
  99.     GEntry  *gh_GEntry;        // underlaying control node
  100. } GHandle;
  101.  
  102. #include <fsovl-protos.h>
  103.  
  104.